#include <iostream>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>

int main(int argc, char* argv[])
{
    if (argc != 3)
    {
        std::cout << "./mykill signumber pid" << std::endl;
        return 1;
    }

    int signum = std::stoi(argv[1]);
    pid_t target = std::stoi(argv[2]);

    if (kill(target, signum) == 0)
    {
        std::cout << "send signal " << signum << " to process " << target << " success" << std::endl;
    }
    else
    {
        std::cout << "send signal " << signum << " to process " << target << " failed" << std::endl;
    }


    return 0;
}